import { Image, ScrollView, StyleSheet, View } from 'react-native';
import Swiper from 'react-native-swiper';
const App = () => {
  return (
    <ScrollView style={styles.container}>
      {/* 轮播组件 */}
      <Swiper
        style={styles.wrapper}  
        showsButtons={true} // 显示左右按钮
        autoplay={true}   // 自动轮播
        autoplayTimeout={1} // 自动轮播时间间隔
        removeClippedSubviews={false} // 关闭视图裁剪
      >
        <View><Image style={styles.img} source={require('@/assets/img/1.jpg')}></Image></View>
        <View><Image style={styles.img} source={require('@/assets/img/2.jpg')}></Image></View>
        <View><Image style={styles.img} source={require('@/assets/img/3.jpg')}></Image></View>
      </Swiper>
    </ScrollView>
  );
};

const styles = StyleSheet.create({
  container: {},
  img: {
    width: '100%',
    height: '100%',
  },
  wrapper: {
    height: 200,
  },
  input: {
    borderWidth: 1,
    padding: 8,
  },
});

export default App;
